package com.itheima.controller;

import com.itheima.domain.User;
import com.itheima.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @PackageName: com.itheima.controller
 * @ClassName: UserController
 * @Author: lin
 * @Date: 2020/6/18 11:14
 * @Description:
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    @PostMapping
    public boolean  save( User user){
        System.out.println(user);
        return userService.save(user);
    }
    @RequestMapping("/save")
    public String toSave(User user){
        userService.save(user);
        return "添加成功";
    }
}
